package org.example.demo;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

public class Demo03 {
    public static void classs() {
        Map<String, String> map = new HashMap<>();
        map.put("韩愈", "Java");
        map.put("柳宗元", "MySQL");
        map.put("欧阳修", "ArKTS");
        map.put("苏洵", "Python");
        map.put("苏轼", "Linux");
        map.put("苏辙", "ArkTS");
        map.put("曾巩", "Spring");
        System.out.println(map);
        System.out.println(map.replace("苏轼", "HTML"));
//        Set<String> keySet = map.keySet();
//        Iterator<String> it = keySet.iterator();
//        while (it.hasNext()) {
//            String next = it.next();
//            System.out.print(next);
//            System.out.println(map.get(next));
//        }
        Set<Map.Entry<String, String>> entrySet = map.entrySet();
        System.out.println("教授ArkTS的老师有：");
        for (Map.Entry<String, String> entry : entrySet) {
//            System.out.print(entry.getKey());
//            System.out.println(entry.getValue());
            if ("arkts".equalsIgnoreCase(entry.getValue())) {
                System.out.println(entry.getKey());
            }
        }

    }

    public static void main(String[] args) {
        classs();
    }
}
